package com.manager.cms.controller;

import com.manager.cms.annotation.IgnoreAuth;
import com.manager.cms.annotation.IgnoreLogin;
import com.manager.cms.common.ReturnResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 */
@Slf4j
@RestController
@RequestMapping("/error")
public class ErrorController {

    @IgnoreAuth
    @IgnoreLogin
    @RequestMapping("/tokenError")
    public ReturnResult tokenError() {
        return ReturnResult.build(401, "未登录或token已过期");
    }

    @IgnoreAuth
    @IgnoreLogin
    @RequestMapping("/authError")
    public ReturnResult authError() {
        return ReturnResult.build(403, "无权限");
    }
}
